home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 26
/
Cream of the Crop 26.iso
/
program
/
ddj0897.zip
/
RCSC.ZIP
/
PACKAGES
/
AWK320.ZIP
/
FACT.AWK
< prev
next >
Wrap
Text File
|
1990-06-04
|
197b
|
12 lines
# calculate and print the factorial of the input
function factorial(n) {
if (n <= 1)
return 1
else
return n * factorial(n - 1)
}
{
print $1, factorial($1)
}